home *** CD-ROM | disk | FTP | other *** search
- Path: news.ptd.net!news
- From: onyx@postoffice.ptd.net (Matt Ayres)
- Newsgroups: comp.lang.c
- Subject: Re: Why is Gets() so bad?
- Date: 6 Mar 1996 23:33:45 GMT
- Organization: Neutron
- Message-ID: <4hl7cp$m84@ns2.ptd.net>
- References: <4hb1ie$pa7@ixnews2.ix.netcom.com> <4hdvuv$3vr@gryphon.phoenix.net>
- NNTP-Posting-Host: cs2-15.con.ptd.net
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=ISO-8859-1
- X-Newsreader: WinVN 0.99.5
-
- In article <4hdvuv$3vr@gryphon.phoenix.net>, brucew@phoenix.net says...
- >
- >In comp.lang.c
- >studwoof@ix.netcom.com(Studcat's Big Studdog.) wrote:
- >
- >>Hi.. I'm not a newbie.. I don't even use Gets(), fgets(), or scanf.. I
- >>use my own getstring function. My question is that everywhere I see
- >>that gets() is bad. Why exactly is it so bad? Could someone please
- >>explain in more detail than what the FAQ does? Thanks.
- >
- >It's really simple. gets() gives you no control over the quanity
- >of chars input. Without this control, there is ALWAYS the
- >possiblity of your array that stores the input being overrun.
- I am still sorta a newbie and I hate gets() for that reason. Could you
- show me some code to write my own gets() function? It would be much
- help.
-
-